package com.yangguang.huahui.ui.adapters;

import android.app.AlertDialog;
import android.content.Context;
import android.view.View;

import com.yangguang.huahui.R;
import com.yangguang.huahui.baseadapter.BaseQuickAdapter;
import com.yangguang.huahui.baseadapter.BaseViewHolder;
import com.yangguang.huahui.entity.SelectData;
import com.yangguang.huahui.listadpter.CommonAdapter;
import com.yangguang.huahui.listadpter.ViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2017/3/10.
 */

public class SelectAdapter extends CommonAdapter<SelectData.ListBean> {

    public SelectAdapter(Context context, List<SelectData.ListBean> data, int layoutId, OnClickCallback clickCallback) {
        super(context, data, layoutId);
        this.clickCallback = clickCallback;
    }

    @Override
    public void convert(ViewHolder holder, final SelectData.ListBean item) {
        holder.setText(R.id.tv_select, item.getClassname());
        holder.setOnClickListener(R.id.tv_select, new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                clickCallback.callBack(item.getId(), item.getClassname());
            }
        });
    }

    public OnClickCallback clickCallback;
    public interface OnClickCallback{
        void callBack(String id, String name);
    }
}
